#coding=utf-8
import psutil,os

#
# 查找进程名,存在返回1
#
def existProcess(name):
    pids = psutil.pids()
    for pid in pids:
        pidDictionary = psutil.Process(pid).as_dict(attrs=['name']);
        for key in pidDictionary.keys():
            if name ==  str(pidDictionary[key]):
                return 1
                break
#
# 运行正常,返回1
#
def exeCommand(cmd):
    os.system(cmd)

